#!/usr/bin/env bash
#function: install docker 18.9
#parmeter:
#author:
#version:
#Test:

function installdocker()
{

curl -o /etc/yum.repos.d/docker-ce.repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo  

yum install -y docker-ce

systemctl  enable docker
sed  -i  's/-H\ fd:\/\///'  /usr/lib/systemd/system/docker.service
sed -i  's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config

systemctl  start docker

mkdir  /etc/docker/


cat >/etc/docker/daemon.json<<ok
{"insecure-registries": ["172.27.1.200:5000"],"hosts": ["unix:///var/run/docker.sock" ,"0.0.0.0:2375"],
"registry-mirrors": ["https://registry.docker-cn.com","https://docker.mirrors.ustc.edu.cn"]
}
ok

systemctl daemon-reload
}

installdocker


